stopgap commit ; infinite recursion detection & some refactorings around it, currently broke some pretty print tests
infinite recursion detection complete ; all tests passing