Finish some cleanup, c++ streams and constification + frame printing from C version

Nothing special, just some changes I didn't check in before.