Refactor builder tests. Add BuilderTestCase.