Add a mirrors-based implementation of exports.
Add a few more exports test.
Fix some generated code issues.