Implemented RomanNum class and incorporated check for invalid strings using its to_i method