Balance export: closure

For Issue #11 

Adds closure support for balance export.

Related changes:
Handle errors better.
Updated example.