A Fast Hierarchical State Machine library