app.js: Fix and factor out swatch delimiter regular expressions

The regular expression for swatch delimiter, as well as the one for
"/* Structure */" appeared in multiple places in app.js and were mutually
inconsistent. This modification declares them each in one place and refers to
the declaration from everywhere needed.

Fixes gh-170