Added unit tests for settings module.

Extracted SettingsMock into own tests.mocks module and
added test_settings with unit tests for settings module.

Found and fixed a bug in the settings module with the tests.
It seems like PySide does not properly process the notify
parameter to QtCore.Property so the notify signal never gets
emitted. The workaround is to emit it manually from the
setter function.

Having more Qt using tests showed that the QApplication
singleton does not actually clean up properly in tearDown.
To run multiple tests we now check if it was already created.
We can either create a QCoreApplication without GUI or a
QApplication with GUI. Unfortunately this means until we figure
out how to clean up the singleton we have to have all tests
use QApplication even if they don't need it.