Move coppied dynamic filtering code into candlepin-common