Added more efficient implementations of nodes, predecessors, successors and neighbors.