Added StateMachine behavior to the repair jobs
Refactored the editor javascript