Validation refactoring

I moved the validation to separate methods. I also added unit tests but wasn't sure exactly how to best unit test the methods since all they do currently is raise a ValueError. I was thinking of using from testfixtures import ShouldRaise to check if an error is raised on bad strings, but if we're just going to change that then there's little point in currently testing that.