Node refactor

This ended looking pretty nasty compared to what I actually did. Just want someone to review the changes I made before merging it in.