world: Add dirtiness tracking as an event to the chunk cache.

For reasons I'm not quite sure about, this unbreaks two expected failures. Hm.
world: Fix up save_chunk() and make its callers less racy.

Refs #366.
world: Switch caching subsystem to separate caching object.

And fix up a bunch of callers nearby.

Maybe the ``_cache`` attribute shouldn't be private?

Refs #366.