Biotech firms are tantalizingly close to unraveling the mysteries of memory. On the way are drugs to help fading minds remember and let haunted ones forget.