Nearfield and farfield boundary-integral representations of free-surface flows