Added server support for term.js
Added the functionality for server side termjs, might have broken something