Update module layout to package custom scope dependencies in lib/

Fixes gh-2187