Refactored huge parts of the DoozR Core and added State Pattern