JSON-producing filter for Template-Toolkit