Initial check in of rule filtering and feature function changes. Compiled but not tested