I've always been taught that "batshit crazy" originated because bats are disease carriers, and that prolonged exposure to their guano makes a person nuts. Now, to back that up.
First, the CDC recommends avoiding bats because they have been known to carry rabies, which in and of itself is bad, but there have also been new discoveries recently that bats also are carriers of a whole host of other things, such as hemorraghic fevers, lyssaviruses, coronaviruses, and a variety of other lovely things that tend to affect your brain. They are also known to be carriers of histoplasmosis, which can be present in their excrement. It's generally not a good idea to expose yourself to bat poop, although apparently it makes a good fertilizer.
As for the shithouse rat, I've got less on that. Seems like a lot of people on the internet tend to assume the original is "nuttier than a shithouse mouse", because apparently mice would eat nuts and thus excrete bits of nut, and where better to find piles of nuts excreted from mice but the shithouse?
It's also been suggested that it is not the shithouse making the rat crazy, but the sheer fact that the rat would live in the shithouse instead of somewhere less, well, crappy, that makes the rat crazy. I can't, unfortunately, find definitive backing on these, short of a lot of people in a lot of random forums saying that is what they think.