Fix flake8, create test database in Travis