BUG: nanpercentile/nanmedian 0-d with output given.

Also some PEP-8 fixes and test improvements
Merge pull request #4749 from seberg/0d-nanperc-out

BUG: nanpercentile 0-d with output given.