Adds subtyping and generics to formalization