Remove and consolidate various uses of reflection.

Any reason not to use util.MapKeys here?