added ability to search for main files in 'dist' dir, and optionally ext...

...ra search dirs relative to canonicalDir. This can help with finding libraries like jQuery, which are sometimes distributed in a 'dist' dir beneath the top-level dir.