Initial commit of hsm moved from http://sourceforge.net/projects/hstatemachine/