Python 3 compatibility

With the cglpk solver, we can support python 3 as well as python 2. This will only get harder with time, so it's probably best to do it sooner rather than later, and ensure that code can be tested on both platforms.

There are some subtle bugs which don't raise exceptions in python 2 but did in python 3. Testing on both (which the travis continuous integration tests will now do) will result in more correct code.