Added a bunch of new classes. Refactored much code. Implemented
retrieve-function.