fix compilation warnings; reformat code.
add pretty_print.hh & accompanying test code.