McLaren have gone through a difficult season, but a proper look at their new MP4-31 suggest they have put in considerable effort to come back from that swiftly.
A place to discuss the characteristics of the cars in Formula One, both current as well as historical. Laptimes, driver worshipping and team chatter do not belong here.
1) Yes this is legal. Within the 30mm allowed for endplate thickness you pretty much don't have any restrictions or obligations. The only thing you are required to do is keeping a minimum surface area.
2) Difficult to tell what the purpose is. My first guess is this a one off/low drag configuration. These slots will introduce a lot of neutral pressure underneath the rear wing, which will decrease the pressure differential. Note that McLaren still runs a rear wing with a high AoA. That wing will have a lot of its downforce cut however by that introduction of higher pressure in what normally should be a low pressure zone. I'm in the dark here, but going from intuition they want to keep a good upwash flow from the rear wing with the intention to still drive the diffuser. It's about aero efficiency. Although this perhaps might also have a negative impact on diffuser outwash.
I am skeptic however this is really that good of a solution. It looks bombastic, but I very much doubt this brings any significant advantage compared to more normal solution, if it already brings any advantage.