Perhaps it can be posted here. The question was asked, and since I was going to do a similar thing, I figured I'd look into it. The problem was even more interesting than it looked at first glance and involves several areas. I was going to put it in free access, but since no one is interested, I will not hurry. I will post it anyway, but very later, when I solve the related issues.
