Now supports using a Proc for :threshold argument, similar to how the :key argument works