Initial patch with all code from CableLabs repository.