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