Added __len__ method to preferences class.
Added __len__ method to preferences class.

Also fixed related bugs in function that loads preferences file, which
sometimes returned a dictionary instead of a preferences object.
HaroldMills/Vesper,HaroldMills/Vesper,HaroldMills/Vesper,HaroldMills/Vesper,HaroldMills/Vesper