Well, I don't want to start a ruckus or anything, but...
My understanding is that it is ILLEGAL in certain counties to use a ported speaker in a cabinet.
Just another example of the great work our government is doing to protect the masses from themselves. I mean, who KNOWS how horrible our collective audio experience would be if people were allowed to put their own speakers wherever they damn well please, and wherever sounds best to them? Furthermore, I understand that SOME scofflaws actually MOVE their speakers to different locations - even from bookshelves to stands of differing heights - throughout the course of their ownership! Fortunately, there is legislation making it's way through congress right now to ensure that all American speaker installations can only be performed by licensed technicians, and all mounting must be made permanent by chemical or mechanical means sufficient to ensure that moving the speakers after their initial installation will be impossible without dissembling them.
Seriously, ANY speaker is going to sound suboptimal if you put it in a bookcase. Don't worry about the ports. However, if you're going to lay the M22 on its side, too, you might be better off with an upright M2 or M3 instead.