Statecharts for the rest of us...in javascript