move a few local variable assignments in the typer closer to their usage

specifically, move some _ = self calls closer to the closure they SHOULD be captured by but aren't
add apache 2 license to gemspec