Implementing GetNodeCount method to compute node count on-the-fly. Update unit test.