Previously, the logic for copying an XBlock's OLX to the clipboard
was directly in a POST view handler. This commit extracts it into a
Python API function.
In addition to following architectural guidelines [1], this change will
help me develop the Content Libraries Relaunch, as I need a way to
locally test library content reference via copy-paste while the UX for
it is still being developed.
[1] https://docs.openedx.org/projects/openedx-proposals/en/latest/best-practices/oep-0049-django-app-patterns.html