Organize modules

  - all modules have 'type t'
  - all modules specific call backs are called 'cb', multiple callbacks are labeled with a
    more specific postfix (cb_write, et cetera).
  - Only two modules are in a recursive definition, this may be expanded later

Issues
  - some types are not used; it looks like they need functions to turn a set of flags to a
    packed integer, these are preserved but labeled with "UNUSED".
  - the examples/ are not updated in this changeset