Fix unit/functional test isolation

Make the unit tests work as non-root and outside a dev environment.