Move job timeout handling to Worker class for better customizability.

This PR moves job timeout handling to worker class so it can be easily changed. See discussion on #303 for more details.