We most likely want simplejson first
Simplify check for string in record formating
Use dict.get instead of ternary statement
Drop unused imports
bytes is a reserved keyword
Fix more pylint recommendations
PEP8/misc fixes

Fix indentation, spacing, imports order, variable names, etc.