Enable Travis CI testing

Contains also Python 2.6 compatibility and other minor fixes.

To enable Travis for the repository, follow the instructions at http://docs.travis-ci.com/user/getting-started/ .