Added median function to stats.py

See my awesome median code!!!