Python 3 compatibility, and updated documentation