Introduce node adjacency lists

Replace all occurrences of string with NODE
(where applicable).