properly clear out emails and documents lists after sharing docs. fixes #834
Merge branch 'bert'. Fixes #834