Turn check_connected into a macro for cleaner one-line functions.

Again hat-tip @blakejohnson for macro help