Change setMap in Layer/TMS and Layer/Zoomify to use layer.maxExtent

As discussed in #823, map.maxExtent may not be set, so use maxExtent from layer instead. This is same behaviour as Layer/XYZ.

I ran the tests for TMS, but there don't appear to be any tests for Zoomify :-)