Tidy up scripts and README, and add a basic test.