rearrange globals and clarify comments
Specify initial purge time in minutes
Shut down before exiting, even on exception
Comments & whitespace