ENH: Add possiblity to enable/disable module paths

Fixes #2256

Signed-off-by: Chrystel Juan <chrystel.juan@kitware.com>