Added base functionality for restoring. It's broken like my soul.

Temporarily removed fsync.