Using `from __future__ import absolute_import`, and `from functools impo...

Using `from __future__ import absolute_import`, and `from functools import reduce` to improve py3k compatibility.