Simplify worker.work() by moving some functionalities to relevant methods

This is my first attempt to simplify ``worker.work()``. I think it looks much better now.

Out of all ``Worker`` methods, ``perform_job`` seems to be the most complicated now. We can simplify this later by moving some logic to ``Job`` class.