Move done and abort processes to Lua scripts.

Benefits:

1. We see the done and abort processes side-by-side.
2. The Lua script's Redis interactions become less complicated.