Added support for Python3, and a Python .gitignore.

Exactly what it says on the tin. Tested under Python 2.7.8 and 3.4.1. All changes designed to be cross-compatible. Used __future__.absolute_import to allow Python 2 to understand 3's imports.