CF-345: json schema

Changes to add validation to PreferencesService. Further clean up is necessary. But I would like to submit that to avoid the PR from getting too big to review. 
* Use JSON Orderly API
* Add happy path unit tests for PreferencesService API
I don't know much slick either. But this function is called before any session is established. My guess is it will create a new session, but destroy it by the time the function is done.