Turn session-persistence plugin into a library