Moved code for retrieving table schemas from main to getTable function. Added getFactory function which loads a template file for outputting a factory class which is used in php to retrieve the MySql table related classes.