Initial commit

This was pulled out of the GOV.UK puppet repo.

I have added some tests that cover all of the different results that
can be emitted by the script.