Attempt to refactor two "duplicate" functions.

Attempt to extract a generic function `prelude-get-positions-of-line-or-region` from `prelude-duplicate-current-line-or-region` and `prelude-duplicate-and-comment-current-line-or-region`
Merge pull request #499 from bixuanzju/patch-1

Attempt to refactor two "duplicate" functions.