Rewrite HEAD getCssJsHtml() function, moving CSS to <head>, and all JS including inline JS to footer