Re worked the stand alone .mat converstion program and modified some supporting
methods in code_tools to make them more generic.