Added idempotent switch, double the performance for BFS. Woo! TODO: change interface to other primitives which use BFS.