Bug 1029966 - rewrite settings build script in javascript