Revert "No locking in datastore. Locking needs to be re-thought"

This reverts commit cc6fea3bd5a0bf2a8377fe8e33a7e969e7e1b184.