C++ immigration of Javascript version of adblock