ENH: add extended axis and keepdims support to median and percentile
MAINT: revert back to separate median implementation

Merging median and percentile make would break astropy and quantities as
we don't call mean anymore. These packages rely on overriding mean to
add their own median behavior.
Merge pull request #3908 from juliantaylor/median-percentile

add extended axis and keepdims support to percentile and median