From String Rewriting to Logical Metabolic Systems