Fix Settings locking
Split settings into seperate source and header files

This also cleans up settings a bit