Refactor the project and implement the (5n+1)%(2^i) PRNG algorithm as both a
standalone function and a state-aware class.