Tidies white space & code.
Adds a full suite of unit tests for segmented view value manipulation.  These should verify #973.
Takes away the unnecessary value massaging that coerced empty and single value arrays to null and a single object respectively.  Verified by the previous commit of unit tests, closes #973.