Cleaned schemaGenerator.
Refacted database class to use only one connection/cursor.