added the new PrefsHelper class and put it in most places
added a bunch of javadoc comments