Tidied up database class.
Added getTableName class to database class.

This makes it easier to handle prefixes on table names.