Added tox the build/test process

Also fixed a few pep8 errors so that all tests (including flake8) will
pass.
Updated Travis-CI config to use tox for tests