Refactor smpreferencearray

Cleans up code in SMPreferenceArray and extending classes. Needed for modifiability and for understanding how SMDataModel works internally.