Closes #2318: getMaxZoom returns prev layer on baselayerchange

Remove all old layers before adding new ones to avoid
the old properties being returned in the baselayerchange handler.
Merge pull request #3048 from CloudNiner/feature/fix-2318

Closes #2318: getMaxZoom returns prev layer on baselayerchange