make /package/foo?json return JSON template context as a JSON object

how about `'json' in request.query`?