Changed 'finished' to 'ended' on jsnode to be consistent with the spec.
Tweaked scheduler behaviour when 'running' is manipulated.
bugfix