nodetype fixes

Because all .h files need each other, classes need to be forward
declared. Somewhere in that mess, NodeType is not correctly loaded. For
this reason nodetype is now in their own .h and loaded from relevant
files.