Use lua generator in place of ex_cmds_defs header trick

Closes #788
Fixes #379
Ref #549
Add const qualifier and explicit length
Fix problem with test47: addition is not bitwise OR

:diffsplit command used to include some flag value twice. If I was using bitwise
OR it would be OK, but I had addition here. Changed to use bitwise OR.
Extend documentation
Merge pull request #840 from ZyX-I/generate-ex_cmds

Use lua generator in place of ex_cmds_defs header trick