New tile image cache and tile queue improvements

We now reuse tile images by maintaining a cache of image elements with a
simplified LRU expiry policy (by order, not by timestamp). The tile queue
is bypassed for images that are available in the cache, so they can be
rendered immediately. And the tile queue itself loads more than just one
image at a time now (2 per layer url).
New TileManager

This removes all tile queueing/loading specific code from Layer.Grid
and creates a new class that manages tile loading and caching.
Adding destroy method, as suggested by @bartvde
Configure maps with TileManger instances (and not the other way around)

This resolves issues with destroying caches on window unload, and makes
cache sharing among maps less confusing to configure.
Adding API docs for the tileManager property
Updating tests
moveTimerId is no longer used
512 tiles is too much for some mobile browsers
Remove images from dom when replacing them with cached images
New beforeload event and slightly changed loading sequence

Having the TileManager remove an image from the DOM, then setting the
cached image, and then having to position it felt a bit awkward. With the
new beforeload event, the setImage method and putting renderTile before
positionTile, providing the cached image feels way more natural.
Enable fade-in for tiles from cache when we have a backbuffer
Recovering from merge conflicts
ability to switch between singleTile true and false
add tests and finish off the functionality for switching between singleTile true and false
incorporate @ahocevar's review
fix indentation
Merge pull request #821 from bartvde/singletile

ability to switch between singleTile true and false on the fly (r=@ahocevar)
Overview map should use map.getMaxExtent
Map: correct docs for maxExtent
Merge pull request #822 from probins/mapmax

Map: correct docs for maxExtent