Changesets from the proposed merge into scrapylib

Here my rebased, updated and squashed changes from the [other merge request](https://github.com/scrapinghub/scrapylib/pull/35).
I they are okay to be merged I would then update the other MR afterwards.