Initial draft of parts of core DBI module.