Prep for main and temp databases

Lay the groundwork fixing the db bloat and using a temporary database
for transient episodes.  This commit specifies :db ... in all cases
where it is a valid keyword.  This is functionally equivalent to the
previous version.