Decouple socket path lookup logic
Better error message in case session name is too long
Added -C option

for collection of exit status and creation of new session in one go
Slight formatting change
Improve terminal restoring

Instead of simply moving the cursor to the bottom of the screen
use the alternate screen buffer i.e. the smcup/rmcup capabilities.

This is currently hardcoded to the xterm originated \e[?1047{h,l}
sequence. I also patched dvtm to support these.
Update testsuite to reflect terminal restoring changes