Functional testing

From https://github.com/izidormatusov/gg_scraper\
    /commit/d85483b2204591951f4667d4b0f15a9c0570ec58
Fix setup.py.RunTests.run() to return proper exit code.

The previous situation didn't fail on Travis-CI.

But this does, so I had to include also a number of fixes for revealed
issues.

Fixing #314, #315, #316, and #317