Renamed toposort variable names to a be more sensible.

Added a failure condition.
Added two ways to check that the failure condition was met (try/with and NUint assertions)