Added tojson template filter to be able to pass Pyhton objects as JSON to JavaScript. Use sparingly!