Refactor js libraries and fix rewriterule to not rewrite the javascript files