Extracted logic for wrapping a model, and its history, and doing its
contrasting unwrapping procedure, into class RestorableModel.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>