Re-implemented counting_apply_hash to remove all code duplication. Updated counting_bloom_filter to use new version.