Big refactor

Local testing passes (yay)
Jenkins testing passes (yay)

I wrote unit tests around new functionality, they all pass (yay)
I even wrote kitchen unit tests, and they all pass (yay)

Can I get a merge over here!