fix for equally preferred states

lists of equally preferred states now being handled correctly when part
of the preference range being varied.
input testing and new function for YND math

more useful exceptions for bad inputs to YND subtraction functions, and
a new subtractStateSets function.
tests for inverse approach and state set math