refactor to enum/constants for node types

Replace string references to centralised VirtualNodeType class references. This helps when making changes to
names and types and not repeating string literals in test cases etc.

Tests are passing on this branch