What do we think about making this more general/configurable?

In particular to be able to do things like JSON-equivalent hashing, and other kinds of
configurability.

I took a stab at it.