add python 3 support

this patchset adds support for python3 wile still working with python2.
print_function is imported from __future__,
this makes python2.6 the earliest version that should work
(only tested with python2.7 and python 3.4)