libchula/utils.{c,h} clean up

The utils.{c,h} files needed some serious clean up. This patch takes
care of the most important stuff. Documentation and tests are still
missing though.