Rough implementation to add support for 3 term sums.

There is lots of code duplication and none of the 'common' test cases are checked against both types. So there is still work cut out for me. This illustrates the difficulty of also maintaining the test coverage as the requirements evolve.
Also, because more functionality is in place, you risk to more easily skip certain tests, since you already have a strong body of working code.