Fix failing tests, rename function and other cleanup

A number of small fixes:
* Fixes failing tests.
* Liberally renames a function :]
* Restructure requirements following a pattern from "Two scoops of Django" that I find quite neat
* Flake8 the project and clear errors
* Use ``__version__`` for version, which is the more standard Python metadata approach

After this, installing requirements will be a single line:
```
pip install -r requirements/<env>.txt
```

where ``env`` is either `runtime`, `test` or `ci` (for now)