Dirty rectangle rewrite

This is a rewrite of the general mechanism that Crafty uses to track dirty areas of the screen.  

1. Only which entities have changed are tracked.  The dirty regions are then calculated right before the scene is drawn.  (The old method was to calculate dirty regions as entities changed, which was inefficient.)

2. The algorithm for merging rectangular regions together was corrected and simplified.

3. This patch also changes the order in which entities are drawn; everything within a particular dirty rectangle is now drawn in one go.

There's an alternative patch for 2 that got merged to master; I'm going to go ahead and submit this pull request anyway.  If that one gets merged to develop, I'll do the work in making them compatible.  However, change 3 would actually *also* fix the problem the other patch was targeting  ([demo](http://abstractvisitorfactory.com/~tim/AlphaProblems/alternateFix.html)) ; so ideally we'd want to measure how the two algorithms compare.  (As part of change 3, the dirty region is cleared directly before it is drawn to, instead of clearing all regions before drawing any entities.  This prevents the overlapping alpha issue that prompted the other patch)