Find imports

This factors out (and makes a little more general) juju-core's FindJujuCoreImports.
It also adds a few tests.