Updated the documentation - still needs a second pass, most likely a few errors.
Added a purge at the end of the tutorial example, just for safety.
Removed two misleading comments about memory_cap. Both functions work properly now.