Add cleanup functions, random selection to PrefixRoutingTable. Fix node counting bug.

Add cleanup functions and functions to perform random selection of nodes to the prefix-based routing table. Fix node counting bug.