Refactor cartesian_valid_addrs() to return min max

Instead of returning an array of possible valid address for a connection
gene, the function now returns an array containing the min, max of valid
addresses.
Add ability to generate random genes for cartesian