Simple code to read mangle masks, calculate ids and weights, and generate random points