Some changes for overall build, and npm-compatibility.
(Still learning...)