Fix a couple multithreading issues

* Start background thread *after* initializing internal data
* Assign layer to map tiles in foreground thread