All logic implemented

All the application logic is implemented at this point.
The only things left to do is to add some tests, do some error checking
and cleanup and update documentation.