Made database code non-static
Experimenal queueing implementation.

Still missing: error handling, retry, worker