Use util.log for logging in acyclic phase
Use util helper for determining ordering
Use cp-data instead of graphlib for data structures
Remove self loops during the acyclic phase

We also rerun the acyclic algorithm during the rank phase if we've
collapsed ranks. This ensures that we've not created any cycles as a
side-effect of the collapse.

Fixes #91