Tested and finalized the tile painter.
Implemented a few optimizations.