Add a few tests and util methods.