partial merge of Simon's changes
This merges almost all of @g-simonperkins's changes, except for the package naming, which needs more discussion.
This merges almost all of @g-simonperkins's changes, except for the package naming, which needs more discussion.