Replaced all contains methods with RangeSet operations.

Made resourceprep faster, others slightly slower. Less redundant code to maintain/optimize later though