Added a window which displays loaded resources

Can be opened with F10.
Fixed possible crash on shutdown

When deleting SpriteDefinition instances during shutdown it could happen
that an ImageSet that was deleted as a result would try to decrease the
reference count on an ImageResource that had already been deleted.

Also switched the two QMap instances in ResourceManager to QHash, which
should be a little bit faster since it does not bother with sorting its
contents.
Added support for tileset margin and spacing

Also tried to reduce the amount of calculation done for each tile a
little by remembering more about the current tileset.

Closes #44