Various cleanups + new nagios tests, dodie(chdir) fixes