Huge refactor: add sqlite config support.

This ended up tidying up a bunch of code that was getting increasingly hacky
anyway.
Python 3 compatibility.
Add tests for password generation.
Fix python 3 compatibility again.
Add more tests; remove dead code.
Update .gitignore for coverage.
Add more config tests.
Finish off config tests.
Add travis support.