get rid of shadowing variables (mrbgems)

Mostly renaming, except that the definition of struct accessor methods
is now done in a new function.
Merge pull request #2585 from cremno/get-rid-of-shadowing-variables-mrbgems

get rid of shadowing variables (mrbgems)