Big refactoring of tools, can now be hosted as a web service or run in a
sandbox (can load scripts from remote locations via require.js).
Also refactored the way modes work.