Initial table code, refactored some database methods to be more supportive of dynamic queries (kind of).