Improve test coverage and Python 3 support

Coverage is now up to 82%!