Changed handling of MapObject create/delete in undo system

Experimenting with a different way of handling map object creation and deletion in the undo system. This way is a bit more memory and cpu intensive, but should be much less error-prone than the previous method. Very much unoptimised currently (I can think of some simple ways to reduce memory usage etc), but I want to see if it actually works better first