Replace C++-style comments with C-style comments to eliminate warnings.
Fix compiler warning (bad cast leading to signed vs. unsigned comparison).
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.
Ensure that all header files have include guards; remove more unnecessary includes.
Options object should not be a global variable; pass it to a couple of functions that need it.
[PTFM-9696] (Again.) Print a useful message when a file argument is a directory, or is not a regular file.