Tile-rendering code

Wrote tile-rendering code with optional batching.