Heaps more documentation, a little reorganization and some pseudo code
ready for the final changes to handle the new queueing mechanism for
I/O.