[WS] Fixed tally tests
[WS] Code cleanup
[WS] Added balance calculation tests