Make migration code aware of bookshelve changes.
Make migration code aware of bookshelve changes.

This basically apply the relevant bits of 4190d2 rebased on a
new master.

oerpub/github-bookeditor,oerpub/github-bookeditor,oerpub/github-bookeditor