Add some tests to util. Add more documentation.