For period cramps, I never found anything that necessarily prevented them but found
ibuprofen helped very much to alleviate them.
For mood swings, being aware helps. If you use an app (medhelp has a good one called mycycles that you can find under health tools)-- you can see the time period in which moodiness will most likely begin. For me, it's week three of my cycle. Like to the letter, that hits and watch out. My evil twin arrives. My emotional roller coaster twin arrives.