Python 3 Support

- added Python 3 support, without breaking Python 2
- PEP 8 style fixes
- cleanups
- tests in are okay