Median tests

Lots of stuff.