Implement imports and exports.

Might as well do some general cleanup too:

Rename the len attribute of a section to length.

The section, import and export callbacks return 0 on success and anything else
on failure.

Whitespace fixes.

Fix a bunch of copy/paste mistakes in the test script.