Use py.test instead of nose (fixes #343)

See #343 for motivation.

This is still compatible with the previous way of writing tests, both concerning unittest-style test as well as doctests.