Fixed select2 for admin and apps page

Added explicit escaping.
Now internally using a pipe symbol as separator for select2, to make it
possible to use group names containing commas.