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

Also some PEP-8 fixes and test improvements