I’m thinking more and more that Mr. Gold/Rumpelstiltskin wrote the book and “placed” it for MM to give to Henry.
Now that we have confirmation that Mr. Gold knows who he is, it may really be that HE has given all the Storeybrooke residents their memories. Possibly even Regina’s, Regina just thinks she’s in control, but it’s really Mr. Gold guiding how everything works out to ultimately break the Queen’s curse.