Added ReferenceType enum 'because pattern-matching on types is bad'.