There are some software solutions out there that in addition to actually store your writing, have functions that help to store your research, character bios, locations etc... Some are gear more towards writing novels and others can cover a wide gamut.
I've used Liquid Story Binder (which doesn't seem to be actively updated any more) and Scrivener. They both have ways to keep your facts straight.
You don't necessarily need to use software that's specifically created for this. I've also used mind mapping tools (Mindjet MindManager, MindGenius, FreeMind (open source)) when I am starting out with some ideas. Other tools that I have used includes MS OneNote (free), Evernote (on-line), AllMyNotes, Right Note, myBase and Ultra Recall.
Interestingly, even with access to these these tools, I still use Notepad++, or vi a lot of the time to store some info in txt files.
Even with any of these tools, you should always double check and use people to verify that you didn't mess up.