modutils: Try to find and import the module originating a file.

This should resolve issue #467.
modutils: Move the get_modules function to the parent worker.

This way, both the classic and pipeline worker should work fine.
Merge pull request #481 from pooya/467

467