refactored command_handler(), reduced spammy output, various other cleanup