move struct def into include file
remove unneeded verbosity
refactor into log and util modules
change printDiagnostics to conform with the checkErrno contract