Simplify and optimize FindCycles

Finding cycles in a directed graph only requires a simple depth first
traversal, it does not require checking every path in the graph.

This is now fast enough to actually identify and print cycles between

Changes the error message slightly for file and target cycles,
and adds tests for both those cases.

Patch from

Review URL:

git-svn-id: 78cadc50-ecff-11dd-a971-7dbc132099af
6 files changed