Bug 859372 - Refactor root.js;r=past