code refactor with a focus on variables and process saving

* variable names are more verbose
* bash command history fix
* save session data taking pane process tree into consideration
* prepare for plugin system
* other misc refactores