ENH: Add possiblity to enable/disable module paths

Fixes #2256