Add a 'cleanup' api to register cleanup actions

To reduce boilerplate code, sharness can be included via a helper
script, which can do any and all common actions, except cleaning up.
Make it possible for such helpers to register cleanup actions.
Add a test for the cleanup api using a sub sharness
Merge pull request #12 from seveas/cleanup-function

Add a 'cleanup' api to register cleanup actions