New Web-based companies like SharpBrains are selling computer programs that test attention span, cognition, and memory. “Mental gymnastics” products are being targeted to seniors, parents of kids with attention deficits, and stressed-out business executives.