Partial rebase from https://github.com/darkxst/js17/commits/mozjs17-rebase.

Bugs are explicitly ordered and tracked.
Build fails with "c++: error: ../lib.a: No such file or directory".