Python 3.x support.

Also made the following minor changes:
 - PEP8 compliancy
 - Changed some dictionary literals to constructors to make the code more readable
 - Removed a broken link from comments