Node support & various fixups

This looks like it makes some similar changes to #3. Feel free to cherry-pick as desired.