Adding the db queries for creating the postgre database
Refactoring some code and adding additional tables.