Replaced nosetests by pytest

[pytest](http://pytest.org) is a much nicer and more mature testing framework which can simplify the testing code quite a bit. It also has a much more helpful console output compared to nosetests.

(This depends on #71 and will be rebased once the other PR is merged)