CLI fixes (paths etc.)

* Fixed paths so that cli/book.php can be run from elsewhere (still outputs to current directory by default).
* Updated utils.php getMimeType() to fallback on mime_magic if required and possible.
* Added new command-line option for tmpdir, so it's not set in the code.  Defaults to system tmp dir if omitted.
* Changed CLI help/usage to reflect above changes.