New sharing, saving and opening of documents

- Fixed leaks