MedianTime should be a real median
For TestNet I changed the MedianTime to an average value instead of a median, but a median value would be better according to the name.
Also, MedianTime should never go backwards. So we should have something like:
HEAD.medianTime = MIN(HEAD~1.medianTime, computedMedianTime)