Avoid re-initialising client unnecessarily.
Merge branch 'master' into avoid-running-two-updaters
Don't attempt a connection when session is initialised.

A connection only makes sense once the session has been initialised with
login details. Once the app sets these details, the change event handler
will initialise the session.
Remove dead code.

The "else if" part seems to contain keys that are also tested for in the "if"
part.
More direct approach to loading the 1st module when the repo changes.

Too many things change the session in various places, so we cannot rely
on a session change to signal this. By instead explicitly firing a
settings-changed event in the one place this happens, we can bind to that
event specifically.
reset keepUpdating flag as soon as possible to avoid race condition.

It was possible for two updaters to run because the 15 second timeout runs
before the flag is set to false.
Merge remote-tracking branch 'origin/master' into avoid-running-two-updaters
Correctly flag completion of update even if the promise fails.

A failed update would leave _promiseRunning set, causing an incorrect
exception to be thrown the next time round.
Merge pull request #110 from oerpub/avoid-running-two-updaters

Avoid the exception where two updaters run at the same time