Refactor of the code to support MsTest and NUnit

Refactored code to separate out the validation from the tests.