Refactor detection of recursive functions
Refactor detection of recursive functions

Don't depend on code from the old termination algorithm. This makes for
a simpler and cleaner implementation.

mpitid/purity,mpitid/purity