Python import hook that attempts to guess the right directory to import from