removeAbove and removeBelow functions

These two commits should add support for the removeAbove and removeBelow threshold functions.