framework: occupy

@fengjingchao This works. need some refactoring. 
> I send in another pr which change master/slave to 0,1..., that we way, it is easy to handle them uniformly. Can you provide some feedback.

Ack. Agreed. 

> It is still unclear to me as to how each node knows which task/replica it should take on from this pr. Can you clarify?

Instead of panic at line 392, for loop again with s.key + "/slave" ("replica" -> 1,2,3....)