Renamed fun to def. Implemented new subtyping as per emails. Def's still need to separate out args (TODO).