Code refactor: Put some classes and interfaces into their own java files

Classes and interfaces referenced from different packages could be
better placed in their own files, instead of being buried inside
other classes.