More framework

No new functionality, but the structure is a bit better. JUnit test
cause why not.