Major cleanup, increased speed, removed redundancies, allowed for proof merging.