It doesn't do anything productive yet but eventually we could cleanup the database on exit with this.
Created attachment 15478 [details] patch
Comment on attachment 15478 [details] patch Looks good
Checked in.