It may be a good idea to abstract out the creation of the persistenceEngine and leaderElectionAgent into something like
```scala
abstract class StandaloneRecoveryModeFactory(conf: SparkConf) {
  def createPersistenceEngine(): PersistenceEngine
  def createLeaderElectionAgent(master: LeaderElectable, masterUrl: String): LeaderElectionAgent
}
```

with 2 subclasses, `FileSystemRecoveryModeFactory` and `ZooKeeperRecoveryModeFactory` (maybe the name "RecoveryModeFactory" is not so good).

The advantage of this approach is that we formalize the arguments needed for constructing the 2 APIs, and centralize the creation of everything necessary for one recovery mode. Thoughts?