add support for priority-map-keyfn and priority-map-keyfn-by

I went ahead and did this. Let me know what you think.