Bug 1017490 - rewrite clock build script in javascrip

In these two dumps, I would have been more explicit, with something like
```
dump('require.js optimize ok\n');
dump('require.js optmize failed:\n');
```