Why a prep school in Massachusetts replaced its library books with digital versions, and colleges are moving to electronic textbooks.