Python 3 compat (explicit relative imports)

With this change, the script is now working for me in Python 3. I haven't checked whether there are still code paths which aren't Python 3 compatible yet.