refactored code to have more robust error handling.
organised code into packages and added helper method to turn numerals into strings.
extracted and refactored validation to separate class, including basic test.