refactoring, and remove cleanup method

The "cleanup" method is no longer needed, so this removes it.
This also refactors the fork code a bit and adds a "maint"
setting to disable forking; this makes debugging simpler.