This parses JSON, we should use a [proper parser](http://docs.python.org/dev/library/json.html).