Refactor and simplify tests

Reduces code repetition in testing and improves readability of failing tests (when they fail!).


Credit to http://erikzaadi.com/2012/09/13/inheritance-within-python-unit-tests/ for his great tip on inheritance in Python unit tests.