reduce is in functools module in Python 3

I also tested that "from functools import reduce" works in Python 2, so there should be no problem.