Turned script into a class to make it easier to unit test; Some refactoring to encapsulate the logic of number boundary and cleaned the toString function.