Implement active key document
Implement multi uid support
Fix comments