Improve testing

 - Enable testing through `python setup.py test`
 - add Travis CI support.
 - Add Flake8 to test suite
 - Upgrade dependencies
 - Fix broken parts of tests.