Some changes to make the main.py script work with postgreSQL

Also, update the travis configuration to test the application with mysl
and postgresql as well.