Make JS-SDK work from Node.js

These changes are more because the old way is "bad form" than actual fixes, right? (Purely for my own understanding)