Rewrites most of the loader script and the shims.

Removes duplication in both ruby and javascript.

Adds syntax highlighting via highlight.js.