Preliminary work on database class rewrite.