Added app engine support.
Bug fixes.

Fixed random algorithm for drawing a tile.
Initialized variables in pointer events in case we get wierd events out of order.