Add bash history saving and restoring (first version).

This does not yet have flag to turn the feature off.