(PUP-1619) add struct and tuple types to type system

This adds the two types struct and tuple to the type system. A tuple is a fully qualified sequence of types in
an Array, and Struct is a fully qualified hash.

This also contains fixes to other discovered problems in the type system (mainly the Optional type), and in
the type parser.