Add python 3 support

Libreoffice 4.0 will switch its internal python version to 3.3.0
so it's the right time to support that.

Porting done automatically using 2to3 plus print_function import added
manually. Tested on both libreoffice master with internal python
and with libreoffice 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. Testing on more environments appreciated.