Rewrote the hook engine in plain C to reduce the footprint and memory usage. Thanks to Andrey Unis!