Amf export

Export part of #94 with command line export added.