moveUp and moveDown look like they're pretty much the exact same function, with the only difference being whether you use '+1' or '-1' for how you swap tasks.

Perfect opportunity to extract a function!