Adaptation of Apple's Reachability with some block-based conveniences.