Bug 1017490 - rewrite clock build script in javascrip