SPARK-1830 Deploy failover, Make Persistence engine and LeaderAgent Pluggable

And here.