Update to new keymaster version.
Fixed several bugs.
Cleanup session document adapter.