clean up Transformer tests

- removed unused code
- move common code into abstract base