Refactored. Added Database and Auto_generator classes. Started moving database related code to the Database abstraction class. still WIP.