Port of Python 3.4 statistics to 2.7 and up