AMF serializer and deserializer