mediaTypePriority not sorting correctly

I noticed a bug (as shown in the test case) and have tracked it down to a sorting function.  It seems it expected filter to modify the array elements, when all it does it remove falsy cases.  I added a map to do this and it seems to work correctly for me now.