Added some more database access functions. Simplified the data access by
providing some general purpose SQL statement execution and query
functions which can be used by the other data access functions.