Made a slight performance enchancement for converting a node to a string by pre-compiling a pattern instead of having to compile it everytime.