Add test coverage for attach(); refactor constructor tests.