Simplified permissions updating. Docs can now be shared with the domain or publicly. Removed some old cruft aswell.