Remove calls to json.dumps all over the place. Just call it in agent_conn.put()
Pyflakes. math module isn't used in this file anywhere
Get pyflakes to stop complaining about unused imports.