Unit tests for utils.

As it says in the title.