Factored stuff util.c/.h, refactored Makefile