Ripped db.scm to shreds, converted to module.