Firmed up the tests and refactored the calculator - in progress