Add grid_shape pre/postcondition checks.
Correct a grid_shape creation path where ndistdims == 1.

Now when the number of distributed dimensions is one, and there are
fewer elements than the number of engines. Then distributed dimension
will be distributed across 1 engine per element.

Previously it was distributed across all engines, but since in this case
there are fewer elements than engines, some engines were left with empty
distarrays.
Fix small bugs in normalize_grid_shape and make_grid_shape
More descriptive error message for postcondition check.
Bug in make grid_shape
Properly set Distribution.targets and .comm
Remove obsolet test empty distarray test.
Correct mean reduction tests.
properly set targets in Distribution.from_shape
Correct targets on which distarray ufuncs are called.
Correct Random stuff to use the comm from its distribution.
Change test to check for ValueError rather than TypeError.
Remove all 'n's special casing which is handled well now.
Refactor grid_shape making in Distribution.from_shape

as per @kwmsmith's recommendations
Merge pull request #427 from cowlicks/grid-conditions

Add grid_shape pre/postcondition checks.