fix flaky api test
automatically trigger builds once again

this is now done via a process that simply polls the database on a short
interval, looking for new sets of inputs for a build.

serial job execution is preserved; the same interval that looks for new inputs
looks for pending builds and keeps trying to trigger them.

overall this replaces a bunch of complicated scheduling logic.
remove transitional current versions table
fix migrating from existing installations