Initial implementation of hierarchical state machine
Add hierarchical state support and also the transition support