Added Terminal emulator to editor

Added a termlib.js support; but fails; need some revision
Fixed some errors with editor

Integration between editor and terminal: when terminal on
focus, editor cannot state in focus. Find a way to fix