Replace MethodVisitor with GeneratorAdapter

The adapter has helper methods for boxing and unboxing values.