7.x wrlc 66

Queries should be in db.inc as much as possible.