Fix main/test scope for classes

To make it build/run from Idea and Gradle (where test and main
dependencies are separated).