Externalise some JS so it can be cached
Insert JS very late to better cope if jQuery has been pushed down
Merge pull request #1051 from GawainLynch/feature/RateIt

[RateIt] JS cleanup/improvement