REV: Reverting nanmedian from this PR. Now deals exclusively with handling of nans in median.
ENH: #586 Pulls in juliantaylor's specialization. New median with nan checking is now pretty much as fast as the old one. Hence, removed the check_nan flag from previous commits.