Factor out xqueue vars into own vars file, plus minor changes

@jrbl @sefk