Fix JavaScript compilation.
Remove Thor from Rakefile.
More tweaks to JS.