Move mdbook installation into a script and use exact versions from the CI. Update README.md to instruct developers to use the same versions as the CI to sync both environments. This is related to #2620 and it fixes #2588