Move the host parsing into a function, do less globbing

Didn’t intend to refactor anything, but this makes it cleaner to read
and does less work. Probably breaks on everything but the WIP shownotes,
but want feedback on the awful.