pulled up get_text_from_editor() to command_* functions, some refactoring