FIX Excessive SQL queriues but using code cache
FIX PHP warnings
UPDATE Units so that they can be defined by a config/units.csv file related to #33