Implemented toArray for amf objects - Fixes issue #15