In the end I decided it was just too painful to use the NameValue class.
It's a generic class, so every use needs to specify the type of the name
and the type of the value. I could subclass it to make it easier to use,
but at that point it seemed simpler to just create my own trivial class.