Python 3 compatibility

Closes #8