Move python code from tests to test.
Add NEWS file.