ENG-4536 Fixed tests and refactored to support them.