util.[ch] + very barebones dmesg

Just something to get us going.  The dmesg implementation needs more work of course, but should suffice for now.  It is pretty raw.