Add support for multiple databases

Use a database based on whatever port is being used.
Refactor normal test database setup.
Move port argument to base binary.