Squashed commit of the following:
    improve detect-duplicates to detect dups in internal dependencies
    This reverts commit 24cc65dbae0b29db4dc6c4f7ffb1b9cb8d41f87d.
Merge branch 'master' into chunking_scala_bug
WIP