Threaded unitsync

Now, about 50 days after the work on this started, it's high time we merge it.

#### What
This PR contains changes that make unitsync run asynchronously, so if you have 10 sdds and join a game it doesn't freeze for five minutes disconnecting in the process, instead it shows you a spinner. It still takes five minutes though.

This is done by the new UnitsyncWrapper module that communicates with c++ via dojo.topic and wraps it all in deferreds, so every unitsync function returns a promise that resolves to its return value. The unitsync code is now more complex and not particularly well written and uses explicit recursion instead of abstracting iteration in a higher-level function. Some changes were done because the original code wasn't written with async unitsync in mind and there were things like setSync() being called twice in a row resulting in unitsync calls getting interleaved randomly.

#### Stability
@Anarchid has been testing it and AFAIK there are no major issues. Since 90ae80e241ccd8d the lobby complains if the binary version is too old to run threaded unitsync and @ForbodingAngel pushed new builds to steam and they seem to run ok #knockonwood.

This also includes a nicer engine settings dialog.