Add a bunch of unit tests. Quote a few of them fail at present.