semantic: Correctly count methods when adding them to classes.

This was giving functions the incorrect vtable index.
test: Update passing.