Optimize Map.foldMapWithKey.

Use optimalizations from foldMap and traverseWithKey -- associativity
and test for leaves.