Dev Commit

Add state check in Worker's main loop. Adjust some member functions
required by ServerMaster.