typeInfer now fills in type annotations as it goes and returns a Term with all of its type annotations filled in