Add globals declaration in the generated c++ code

Their typing is off, though, so that's the next (and final?) step.