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 but since there's not this is a fix with quite small impact on python 2 users (will import sys and check version).

- Python 2.x and 3.3 supported
- Compact json to minimize request size
- Minor PEP8 changes ''' -> """
- Bumping version to 3.1.2

I've been manually testing this patch in py2 and 3 since there's no test cases provided. Seems to be working just fine.