refactor crash dumps with a test

Depends on: https://github.com/virgo-agent-toolkit/virgo-base-agent/pull/60