Reduce the emitting of object definitions in ps and svg

The cost calculations are very rough, back-of-the-envelope.
In the example from #3345 I get significant file size reductions:

	2.3M	before.svg
	1.8M	after.svg
	916K	before.ps
	672K	after.ps