Properly purge archive based on settings

New archive settings, as documented in configuration file, will control
when the archive is purged.

Addresses #143 and #360