AST debug info

I cherrypicked #34, stripped it down to just the debug code and reformatted it a bit to match the bindgen code style.