Extract main method and related code into a separate class.

Fix scope for Mockito dependency.