Node-style corrections

I made a bunch of changes which seem to make the program function correctly. I'll try to add comments to the diff to explain each of the changes.

I haven't changed the structure of the program at all, but I have a few suggestions wrt how to structure your node libraries as well. I can give you some more feedback on that over slack if you would like.