added preference stuff in header file
added some more constructors
fixed typing error
let setPreference return void
implemented preference methods
implemented serialization for preferences