Emulate a custom terminal in a browser in JavaScript with AngularJS