implement Closeable to allow explicit cleanup

Attempt to address #22