(feat) Added Persistent Middleware

This can wait for a separate PR.