replacing prefs with localStorage
fixed jshint errors
moved "allow collecting data" to bottom