Moved load_settings and change_setting to loose functions

Mostly to make it easier to test them.
Added more tests for settingsmanager