Now using pgdb_tools
Completed functionality and refactored some bits