Setting NODE_ENV=test for tests and using it to control exports
Further test coverage for copyAndValidate
Further improving test coverage