#1628

Rebase wip/no-blankies to current branch
I will move the code to internals package. But with binary compatibile - the problem is with empty new line. Old session save replace whole line and add new line at end. New replace statement with new statement - which have only one line without new line.