Correcting build problems
Fixes and added some unit tests
Refactoring preferences view
Refactoring preferences view, cont. Needs review