Refactored the StringCalculator class and test.