Hi mold can cause problems with memory and concentration yes. The ammonia level may be coming from food additives I have noticed some of the foods such as bread have forms of it added to the packages. One can check and likely should check labels to avoid additives, in my opinion.
Leaks and basements can sometimes be sealed. A friend of mine used bleach on everything and opened up windows and doors to air it out and it smelled better after that. I do not happen to think bleach is all that healthy for inhalation however and if used it needs excellent airing out and ventilation during the process. Chlorine is said to be poisonous. I did hear of a story where a doctor told the family to move out of the house and abandon everything including photographs even for the purpose of getting better from sick house syndrome. Have a nice day!