Refactor commands in handle_command for less redundancy in error handling
Description
There were a lot of repetitions involving sending back the result of commands and checking that the result was properly received. By changing the different parts of the match statement in handle_command to use functions returning results instead, we can reduce the redundancy.
Note
Not all match statements have been refactored, because it either doesn't make sense (no redundancy in the given match), or there it is not possible as is due to having to use the sender for the operation as well as the error handling (and we have problems with move of value).