Making the function more generic.
Fixing indentation.
We can use optimus for this, it's recursive.
Putting export code in separate ns.

Also renaming lein task to export since that's what it's called in code.
Putting both cli functions in same ns, for dat DRY.