Closes issue #586. Updates handling of nan behaviour in numpy.lib.function_base.median.

Please review and add to main branch. I also included a unit test to help with the review process. 

(also, I'm considering writing a nanmedian function which would ignore nans, similar to the nansum, nanmax, etc. series of functions.)