Refactoring + Early tests
Added userprefs file