fix session program save and restore

ensure all non tmux specific save and restore functionality is dependent
on a program. Prepare for program save and restore plugin functionality.
fixes vim and bash save features

mostly logic errors in how the save features worked
adds vim undo history function

adds skeletal for saving vim info and swap as well