Better exit points for cuttlefish_generator:map/2

This PR actually solves #31, but in a more general way that also helps with validations