Make collapsing easier to follow.
Add some documentation.
Documentation improvements and rename some functions.
Bump package version.