Did all the plumbing for the logging functionality.

* Implemented the logging functionality in the C files.
* Stubbed the functionality in the Go files.
* Moved the Fortran print control argument to be with the logging
  arguments, ahead of the exit status arguments.
* Added callback data for the logging function.
* Various cosmetic changes and updates to comments.