Refactor to allow minified js; add r.js build file; conditional debug.