bolt on support for simple JSON-returning services by EGWeb
This patch adds a way for EGWeb context loaders to specify that
a response should be emitted as JSON rather than rendering an HTML
page using Template::Toolkit.
Specifically, if the context as munged by the context loader contains
a json_response key, the contents of that key will to provide a
JSON reponse. The json_response_cookie key, if present, can be used
to set a cookie as part of the response.
Template Toolkit processing is bypassed entirely when emitting a JSON
response, so the context loader would be entirely reponsible for
localization of strings in the response meant for direct human
consumption.
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>