moved getResourceStream to util class

JavaScriptServlet now uses same method as CsrfGuardServletContextLister to read files.

This allows for the javascript template file to be configured with an absolute path.
Also it removes some code duplication.