Also factor out register name generation.
Implement scoping to make member and variable access work.