Add support for python3

Libreoffice 4.0 will switch its internal python version to 3.3.0
so it's to support that.

Porting done automatically 2to3 plus print_function import added
manually. Tested on both libreoffice master with internal python
and with libreoffince 3.6.4 on debian with system python 2.7.

This bumps the minimal python version to 2.6 since 2.5 does not
have the print function.
Merge remote-tracking branch 'python3/master'