Misc changes

Removed references to mysqli variable (so you can change to a different
database, if you prefer)
Filtered errors to go through dberror().