added export command and tests, missing some pieces yet