Clean up main.py and move code to __main__.py and utils/main.py.
fix gui/portable for pull request #903
Some changes in __main__.py and utils.main and other.

Reinsert --no-browser option.

Move some code to utils.main.

Some other small style changes.

Fix merge conflict misstakes.

Change settings behavior. Add tests.

Fix rebase problems.
Merge pull request #903 from normanjaeckel/CleanUpMain

Clean up main and move the code to __main__.py