Fixed preferences scope in xmodules.

Also updated tests to reflect changes, and changed the abtests module to use the preferences scope correctly.  (Note: the abtests module remains untested, and not usable at present.)

@rocha 
@dianakhuang