simple implementation of bfs and dfs
Module-ify graph searches; track node IDs.