I'm not sure what the best place for this is. I think it should probably go in lib/, even though it's testing only. Perhaps we need a lib/test/.