Add project setup.py

This is needed for proper installation by tox, and it's generally a good
idea to have one.
Add tox and Travis config files
Add .gitignore
Move scripts into utils directory
Use explicit relative imports
Make migrations runnable from external modules

These will be used in tests to setup the database.
Make compatible with Python 3

Several things changed for Python 3:

- urlparse was renamed to urllib.parse
- The reduce() built-in is now in functools.reduce
- xrange() is now range(). We didn't need xrange() to begin with since
  it's such a small range so there's no practical performance impact.
- the division operator returns float, so force floor division with //
Remove unused units import
Add global test setup and test DB initialization
Add authentication tests
Add database tests
Fix TypeError when returning results from fetchone()

This would throw a 'TypeError: tuple indices must be integers, not str', because
fetchone() returns a tuple, not a dict.
Add ledger tests
Add generator tests
Add manager tests
Add pricing tests
Add promocodes tests
Fix NameError for undefined `tm` variable in token_deposit()
Fix AttributeError: there's no api_key attribute on Manager
Add Flask views tests