initial hacks on db for per-run db and server.

This branch is now defunct. Per-run is too complicated for right now.