more cases implemented for may_share_memory

Pretty terrible code and needs unit tests, but i believe this represents progress nevertheless.