Remove unused code.
Change minimum required permission level from CONTRIBUTE to UPLOAD.
Remove some unnecessary includes.
Hide a function that doesn't need to be exposed in the Chunk interface; remove some unnecessary includes.