Random discrete uniform tabulation fun
A few general tools imported from defunct twark library