Fix column names admin_id and viewer_id.
Rewrite query strings for simplicity and generality.

In particular, allow overriding the DB schema.