Allow passing in a decycle function

Discussion: https://twitter.com/izs/status/311717633793851392
v4.0.0