updated code formatting, added escaping to twig.js templates