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/

Well this is really written only once here and I can't really see an efficient way to refactor this out (this would add branching + function calls inside unless it's inlined so I'm not exactly sure about how to do it..)