[TEST][CLEANUP] - Refactored to split out related functionality into mor...

...e cohesive classes, added unit tests, checkstyles

Before -> After
0% Line coverage -> 65% Line coverage
0% Branch coverage -> 66% Branch coverage
4.167 Overall complexity -> 2.842 Overall complexity
291 Checkstyle errors -> 0 Checkstyle errors