Revert "fix typescript in build.js to merge files in the correct order"

This reverts commit 9e14f0428126313a3ab090d642bf86ca5d4f15b9.
Revert "add typescript modules"

This reverts commit 1cfda3ab6aadaf6f10421de51ed20f9b8e7ec29f.