Give program elements a data type.
Add tuple type.
Allow definitions in any order.

 * Generate fresh type variables for all definitions up
   front, then unify these after inference.

 * Fix order in 'partitionElements'. Though this is
   immaterial, it looks a little nicer now.

 * Kill some repetition with 'unifyM_'.
Allow polymorphic instantiation in definitions.