Refactor to avoid warnings in the 13 tools.

   This refactoring copes with the change in nullable array syntax (by
   using xccompat.h) and the extra transaction checks in the 13 version
   of the tools.
Move module doc to standard dir