Fix Python 3.3 support

This PR will make the lib work under both python 2 and python 3. Preferably there should be a separate lib for python 3. Since that's not the case this is a fix with quite small impact on python 2 users (will import sys and check version) that might do in the mean time.

- Python 2.x and 3.3 supported
- Compact json to minimize request size
- Minor PEP8 changes ''' -> """
- Bumping version to 3.1.2