TINYGL: Dirty rects system.

This PR contains an implementation of dirty rects system.
You can find more information behind the design and implementation in the following blog posts: 
http://subr3v.blogspot.co.uk/

I could rename those to x and y no prob, I just don't see this as an issue and since this was copied from wintermute I couldn't be bothered changing it (I've seen so many variations that I'm used to any)