TileManager dependency management

If the build does not contain TileManager.js, do not create a TileManager
instance for the map. If the build does not contain Layer/Grid.js, do not
try to add Grid layer instances to the list of layers managed by the
TileManager.
Merge pull request #1000 from ahocevar/tilemanager-deps

Dev examples doesn't work