Add configurable autoremove policy
Refactor modals to use generic modal class