prefs.js (adapted from canek-pelaez version) #21 #59 #69, many update