do not require w3m

Instead of requiring w3m, which is not a package included with Emacs by
default, use declare-function and defvar. This removes byte compilation
warnings, without requiring w3m to be installed.