Support delete book from shelf.

Also clean up some code.