Fully functional battle station...

The code in test.py now goes through the whole process and produces
a relatively sensible reduction of sentences.