The author didn't, as far as I understand, make the code reentrant. The code still operates on mutable state outside of the scope of the call such that two calls that pass in the same inputs may produce different results. The author simply refactored global variables into instance variables of a class, allowing him to create multiple instances of his original program's state.
Interesting to read nonetheless.