Python: support extensions, nicer relative import handling