[refactor] txmempool: split epoch logic into class
Summary: This is a backport of core#18017
Test Plan:
With clang and debug:
ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D11308