Twig filter twig is suppose to escape HTML and should take a character_mask list

This isn't actually documented in their API docs but was in their
tests:
trim is suppose to escape HTML.

twig.js didn't implemenet: the character_mask argument.

This commit fixes both