Js #28 scheduler refactoring

Closes #28.