Improving the metric -> Regex conversion.
Simplifies internal data structures and re-works tests/methods to match
Implement the groupByNode function