Moved the data save procedure into GlobalState.

Deprecated the getReadableDB that accepts a Context.