Use int64_t for the sequence number everywhere.
Add a util::Executor interface, for running closures.
Add a util::Task class to manage async operations.