Fix a couple multithreading issues

* Start background thread *after* initializing internal data
* Assign layer to map tiles in foreground thread
Merge pull request #68 from OpenGeoscience/john/multithread-fixes

Fix a couple multithreading issues