Added copy of JSUtils for finding directives