improve pretty printing of shapes

We should now consistently get:
  (Z :. x :. y)
rather than:
  ((Z :. x) :. y)