Create a helper function for JSON[-P] handling
Create a helper function for JSON[-P] handling

Pull out the common JSON[-P] response-formatting code from the web interface's
route handlers into a utility function.

yazman/statscache,yazman/statscache,yazman/statscache