Check that FreeMarker directives are well-formed, have appropriate nesting and closing tags if necessary