Refactor login logic to the login widget.

- factor out the signal tracking code as a helper class,
- move login logic from MainWindow to LoginWidget,
- add new signals to the LoginWidget to interact with MainWindow,
- add login sequence docs to LoginWidget class,
- improve docs for login methods,
- add LoginState class to handle login states,
- disable login button until data is entered,
- move some properties and actions to .ui file.

`--offline` flag is not tested so I disabled it until next release.