moved terminal HTML creation out into the terminal bar

The terminal bar now creates it's own
HTML elements.

Helper code for this was also added to
util.js.
fixed minor syntax error in slate.script.js