ESC7 & ESC8 and mode reverse change & NEL - tests & fixes & implementation

ESC7 - saveCur
ESC8 - restoreCur
Mode ?5 - reverse entire terminal mode
NEL - nextline (add to beginning of row)

added/changed implementation and added tests.

maybe we need to split the test into terminal code tests and functional test of term_buffer?