Optimize drawing: Dynamically add/remove layers to reduce memory usage #214
With tiling implemented, the main consumer of memory are the large number of layers. In many situations, not all layers are actually needed. For instance, if the user has not enabled territory statistics, the layer that draws the statistics just sits around and wastes memory.
The fix for this is to dynamically add and remove layers as they are needed. Adding and removing layers costs performance, but I expect this to be negligible.