Cleaning up code, re-factoring, using pylint and more JSON.