Bug 859372 - Refactor script.js; r=past