Pull in refactoring and new tests.