Tidies up conditionals.
Adds the driver code I used for development. For posterity, I guess.