Move helper types and function to separate files

* types -> node.go
* functions -> util.go

+ spring cleaning