Moved statemachine into own controller
Refactored device tree for views
Fixed bug in ep_set handler