Fix unit/functional test isolation

Make the unit tests work as non-root and outside a dev environment.
Merge pull request #1911 from ironcladlou/dev/v2carts/build-system

Fix unit/functional test isolation