Added core function to get all metadata as dict.
Implemented recovery mode.

* Tests don't yet exist for it and some of the other functions I
  created to help out. This commit is large enough though.