Add RedisDatabase gateway.

Rewrite database specs.
Refresh unfinished task bucket in redis when updating task.
Use redis for console application.