request, marking service in_progress, clean up, lessen race condition.

Removed some weird legacy stuff that seemed no longer to be used.
Rewrite SQL generation to reduce race conditions on two processes
both deciding they have the go ahead for in_progress at once.