adding -lm, removing newline warnings, make sure JS loads in correct ord...

Misc. command-line tweaks and JS-load-ordering tweaks to the compiler.

(I made these changes on the site back in March/April but forgot to update the repository.)