Moved classes to separate files as a library.