Add implementation of AMF0 reference type encoding