Improve repeat to handle repeat 0, add identity route and an easy breadth_first traversal.