added tests for updateTask and completeTask
added tests for updateTask and completeTask
some refactoring
added JSDoc