Improved performance of redraw mechanism

Only the tiles that have been modified are updated. I also added support for
variable resolution sizes.