Adds tern mode to javascript.
Adds code for confluence mode, but this is sort of non-functional with
the latest confluence.