Finished implementing the term structure and the abstraction and substitution functions.