Scheduler serialization with tests and scheduler factory.