CCM purge fixes

Add support to ccm-purge for selectable database backends and keeping a fixed number of profiles rather than just time-based aging.