Reorder some JavaScript and change footer