small fixes to pixel_buffer.c and friends.
made valgrind happy.
function definitions to match the style of the rest of the program.
added the object concept.