Median along arbitrary dimensions, fixes #6648
Merge pull request #6666 from cbecker/master

Median along arbitrary dimensions, fixes #6648