tests: Move helper classes out to separate file