MODE-2294: Make server side classes serializable

Adds serialization to the server side classes.
`javax.jcr.Session` is not Serializable, so this won't work.