Fix bug wth all 'n's dist tuple.

Also refactor make_grid_shape. Combine validate_grid_shape and
normalize_grid_shape. Add regression test. A fix a few style faux pas.