Gevent support and a new class for back-ground working 

Added gevent support.
And a new class BGWorker can simplify code when we need a back-ground thread/job.