Factor out the file sync step

and improve the SessionParams object

Signed-off-by: Nico Rutishauser <nr@hotmail.ch>
Add documentation of synchronization, adapt tests slightly

Signed-off-by: Nico Rutishauser <nr@hotmail.ch>
Use encryption injection for messages as well

Signed-off-by: Nico Rutishauser <nr@hotmail.ch>