Clean up phrasing code a little
Split out "theory" code to new ns