Changes to make task.js testable