core.sh: add CURL_PRG and JS_PROG global variables

Avoid using "type -P" all the time.
core.sh (log_report): minor, add ~/.curlrc detection
core.sh (create_tempfile): consider --temp-directory if specified

Changes:
- plowup: add --temp-directory command-line option
- core.sh: add 'D' type for argument parsing (check for directory with write access)
- man pages updated

Fixes issue 959.