Added builder for statemachine to basec and modified to-basec rules to use reflect changes in basec syntax (Not finished yet).