Translate SplitCalculator and some related classes to Swift