Fixed types.scm to work with classes and correct generics. Now the functions in
the file should actually work.