MYLOC-144 multiple dialogs

Preventing multiple dialogs from being displayed (cold start, remove main, make main).

I've reworked some of the events that the controller and other components respond to as this had become a little messy and sub-optimal.

A new instance of AutoComplete and API is created for each tests so no need to restore stubs.

I have seen a lot of tests restoring things that do not need to be restored. AFAIK it is only $.on and $.emit that should persist across tests and require restoring.