Also move some previously static functions into their associated classes,
which lets us remove a few unnecessary wrapper functions used for testing.
No change in functionality.
Use git blame dd9a087 to follow the history before this refactoring.
No change in functionality.
This is almost entirely copy/paste, with the main exception of moving the
contents() method definitions out of the class definitions and moving the
needed TYPE definitions out of the header file.
Use git blame dd9a087 to follow the history before this refactoring.