Rewrite of LTI template. Moved all JavaScript to JS file.