Rewrite head, keeping CSS to <head>, and moving JS/inline JS to footer