parseJSON function

md5sum a.out
c21208b431383d2f8a0a08900ba0c6eb  a.out

Refactored request data parsing for 2 controllers to use parseJSON
function from helpers. The heatmap doesn't use it yet because some of
the logic to deal with a JSON array is embedded in it's use of goto.
While the heatmap controller code can be refactored to use parseJSON,
for now this incremental change is good.

Began looking over comments controller and finding points in which to
begin refactoring. The error handling code is the highest candidate as
currently the code is unable to respond intelligently to requests that
trigger 422 requests.