Added statemachine.js spec.js and Makefile