clipboard: simplify interface for undo

With this change, a single call to clipboard_copy_ranges_undo will create
an undo object for the selection.
CmdHyperlinks: simplify.

Use higher-level building blocks for this.  Many other commands ought
to be updated too.