Fix and test compiler's encoding of unions.  Also update list pointer encoding to match docs.