In extension library, use cli.py to do comment propagation

Comment propagation is quite complicated, so use the same (Python) code
from the extension library as is used via the web front-end.

This fixes at least one bug: the old propagation code in the extension
library crashed if the file had had (only) its file mode / access bits
changed in some commit in the "propagation path."