Save & Restore persisted tabs

#1645
next step: try to replace the preview tab when possible instead of creating a new one when the current one is not a preview tab.

review: @devoncarew