First part of the shared code library
Part 2 of the shared code
Part 3 of the shared code

Romoved the Insert/Select/LastRowId saved commands as there will be an
improved query caching mechanism
First stage of query caching

currently all queries on a connection are cached - this may need to
change, but connections are not meant to be held open
Also need to add Select/Update/Delete caching