Changed adt module structure to be {companion, instance, typeclass}.

Typeclasses are now represented via a plain struct that serves as a prototype for an instance of a typeclass.