Add numNodes and randomNode functions to NodeManager