PY3: use six.BytesIO and six.moves.cStringIO
use .seek(0) instead of reset() for compatibility

Since I don't find docs for the .reset() method, I lookup up the source
code, and it should work just the same as .seek(0).

For reference:
https://github.com/python/cpython/blob/8eeb7e9122109f5cc71c22047d5cdd312ca770a0/Modules/cStringIO.c#L281
use io.BytesIO and cStringIO instead of six.BytesIO as suggested
fix tests by using a tempfile instead of BytesIO
Updated input/ouput processor example according to #560.
For consistency, use `job_dir` helper in `SpiderState` extension.

The `SpiderState` extension is the only place not using the `job_dir`
helper.

This might cause an error in case JOBDIR is a nested path which does not
exists, although this is least likely by default given the job dir being
set up earlier.
Merge pull request #805 from darkrho/spiderstate-jobdir

For consistency, use `job_dir` helper in `SpiderState` extension.
Merge pull request #804 from darkrho/issue-560

Updated input/ouput processor example according to #560.
get_func_args maximum recursion fix #728
Merge pull request #809 from nramirezuy/get_func_args-728

get_func_args maximum recursion fix #728
Merge pull request #803 from felixonmars/py3-port

[MRG] PY3: use six.BytesIO and six.moves.cStringIO
fix tests to account for https://github.com/scrapy/w3lib/pull/23
Merge pull request #812 from kmike/fix-w3lib-trunk

fix tests to account for https://github.com/scrapy/w3lib/pull/23
adding some xpath tips to selectors docs
renamed UserTimeoutError and ServerTimeouterror #583
Merge pull request #815 from nramirezuy/retry_timeout-583

renamed UserTimeoutError and ServerTimeouterror #583
improved explanations, clarified blog post as source, added link for XPath string functions in the spec
removes weird indentation in the shell results
Merge pull request #814 from eliasdorneles/adding-some-xpath-tips

Adding some xpath tips to selectors docs
PY3: use MutableMapping instead of DictMixin