add function symbol reference to function reference
change type constructor to hold a type reference to enclosing type
add code generator for algebraic data type