New interface for theories (still needs work in solver.ml)