Organize and clarify documentation

This groups functions into categories and attempts to simplify and clarify the documentation of the junctions.

This is probably easier to read looking at the full file rather than the diff.