It would be nice to think that mart is in some way connected to freemartin (a sterile male bovine) but I can't find a direct link. There does, however, seem to be a link to Martinmas, when the cow was slaughtered for winter meat; and possibly to marbh, which would be cool.
muiceoil and mairteoil are old compound words that were modified in the spelling reform of the 1940s. At this point, it makes most sense to think of them not as compound words, but as single words that follow the leathan le leathan, caol le caol rule, and that muc becomes muic so that there is a slender i before the cl to match the slender e that comes after it.
The plural of muc is muca. muice is the genitive of muc, but under normal circumstances, the genitive noun comes after the nominative noun - feoil mhuice - "meat of (a) pig"/"pig meat". You might guess that muiceoil is just feoil mhuice in reverse, but in the case of "mutton", you get caoireoil whereas the "genitive phrase" version would be feoil chaorach, whereas caoir is just a slenderized version of the nominative caora.
(I'm sure there's probably an official explanation for with it's muiceoil rather than feoil mhuice, but for the purposes of recognizing the meats that you might encounter, recognizing that the root has been slenderized to match the slender ending is probably sufficient).