Wow, what a fiasco. Was the original installer colorblind?
Note I am advising the same thing as Noybman, so I'm leaning toward the reasons for it rather than the procedure per se.
Let's color-code this thing, for Pete's sake!
I am a huge fan of color-coding wires to their purpose/function. In this case, 90% is already done for us. Let's review the color codes.
- Safety Ground == Bare, green, yellow/green.
- Neutral == White
- Always-hot (hot at all times) == Black
- Switched-hot from a switch to lamp(s) == Red
The savant who wired this stuff initially put all the correct types and colors of wire in the wall to match that scheme already. So that was easy.
Lights typically ship with black hot wires, and we don't want the light on 24x7, so use red electrical tape to re-mark them red.
The "Smart switches" on the market generally use black for always-hot and red for switched-hot, so that is already perfect. If they don't, consult their instructions and re-mark as needed.
Plain switches now attach to black and red. Doing this will bring the far-most switch compliant to the 2011 Electrical Code, which requires neutral be cabled to a switch even if a smart switch is not being used (yet).
So, in every box, you simply connect all blacks to all blacks, all whites to all whites, and all reds to all reds. And you're done. Simple like it oughta be.