VariantBuilder

- Improve test coverage, and fix issues found by new tests

- Refactoring for readability and safety