Incorporate the latest work done on Annotator's typed-packaging branch.

There are almost no H-related changes here; it's only about Annotator internal changes.
(Packaging and cosmetic fixed, and a few smaller bug fixes.)

Fixes #938.