Refactor History to be a standalone service.