Added some tests for Task commands

I also fixed some failures discovered by the tests.
removed this and replaced it with a simple `json_encode` call, see the tests about how they look now and if you agree.