Improve shape evaluation.

Shapes can now be resolved for slice and reduce operations without
evaluating an expression first.