Update terminal.js

added jshint and made a few minor corrections