Charter Communications Inc. announced Wednesday an all-stock agreement to buy Liberty Broadband Corp. at better terms than were previously proposed but less than what Liberty had countered with.