Use DOM methods rather than jQuery in setupSlugs()

Also use .importNode() rather than .cloneNode() so the slugs are
created in the right document.

Change-Id: Ia0b6ee5f4e4ef0fbcc9a3fe16f20587da027ae2e
Merge "Use DOM methods rather than jQuery in setupSlugs()"