A Vose's Alias implementation in javascript for finding weighted random values