Almost done with theorem class

Working on cleaning up the search algorithm.