Add documentation snippet.
Rearrange and document host functions.
Add asserts, cleanup code, add member destruction.