patch 8.2.4398: some command completion functions are too long

Problem:    Some command completion functions are too long.
Solution:   Refactor code into separate functions.  Add a few more tests.
            (Yegappan Lakshmanan, closes #9785)
diff --git a/src/version.c b/src/version.c
index b498366..4bfca87 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    4398,
+/**/
     4397,
 /**/
     4396,