Move test JS into HTML files

Fixes #896.
Fix some missing end-of-file newlines
auto merge of #957 : kmcallister/servo/inline-js, r=jdm