Been fighting with books, how to make them work, etc. recently. I bet somebody else is, too. Here's a class for it. https://github.com/nathanaelps/Book I'm happy to tinker with it more, or have other people poking into it.
Afaik you can set the data directly in the setAuthor or setPages methods in the NBTCompound tag, because java passes this by reference. This means we do not need a toItemStack method. So im not really sure if we need to create a object. hmm. A class with static methods would be enough I think. Or we create a object which stores the nbt tag, so we only need to get it once.