JS-ify build.py (Bug 888538)