Fixed a bug caused by a race condition in the layersLoader, and a bug caused by calling sync.startTileCache before initializing for the sync.  Should really refactor Sync.js so all dependencies are passed in