fix bug 1074201 - refactor test base classes and introduce some more

- this also fixes various issues with tests that improve speed and performance
- includes plenty of stylistic changes like PEP8 updates
bug 957802 - Readme: Use SVG badges.

Those badges look better on 2x (and more) displays. They're also a smaller download.
Merge pull request #2784 from jezdez/bug1074201

fix bug 1074201 - refactor test base classes and introduce some more
Merge pull request #2783 from espadrine/patch-1

Readme: Use SVG badges.