This is the first shot at bug #8216.  The extra stuff is in place, now I just need the encode and decode functions.