Implement #3410

See comments for tests that verify backwards compat. I did not test with a
nested dict of grain data yet, but I verified backwards compat for grains with
the new feature added.