Rewrite a good chunk of CoreArity
I found a couple of shortcomings in arity computation, and did quite a bit of refactoring as a result. Regrettably, I have forgotten the details, but I do remember that one part was to do with the infamous "state hack". If we're going to use the state-hack at all, we'd better do it right. Anyway I think this is an improvement. The comments are more up to date too, and more voluminous.