Compress json

- remove excessive whitespace in json payload
- fix some PEP8 violations
- update PyPi classifier
- dumping version to 3.1.2 in lib and setup.py