Finished moving validation and added tests.