Metabolic Networks, Thermodynamic Constraints, and Matroid Theory