Updated extraction method and tests

original tests did not run, not sure if I'm mocking the right interface
If anyone knows you could save me a trip down the rabbit hole
tomorrow...
Better method name, tests passing
Fixed some PEP8 warnings

So that my Vim plugin doesn't complain :)
Merge pull request #253 from alphagov/update-write-validations

Updated extraction method and tests