a javascript flow control class