detect proper libdwarf types

Summary: Current master is broken by libdwarf once again. Other than checking for
a particular init function we should also check if we're allowed to use
a const char* for name separately.

Combined them into a macro for future changes.
Closes #3163
Created from: https://github.com/facebook/hhvm/pull/3163

Reviewed By: @ptarjan

Differential Revision: D1429569
Fix a off-by-one error in hack format region mode and make it available in js

Summary: In region mode in the formatter, the formatter was letting the previous token through.

Imagine the following situation:

[0] = \n
[1] = i
[2] = f

I have selected my region to be from position 1 to the end.

With the old logic, when \n is being processed, pos=0 and new_pos=1. Because new_pos is within the region, silent mode is off for \n, even though I have not selected it in my region.

Using new_pos looks intentional, because it's trying to figure out where my current token ends, so this is an off by 1 error.

Reviewed By: @jwatzman

Differential Revision: D1429649
Fix huge stack usage in `Naming.expr_`

Summary: We were apparently just on the edge of what was acceptable
here, and adding frame pointers in the ocaml runtime/compiler pushed us
over the limit. Do something tail recursive.

Reviewed By: @elgenie

Differential Revision: D1429996
Revert "detect proper libdwarf types"

Summary: refs facebook/hhvm#3163

Breaks centos build: https://gist.github.com/fredemmott/ffa79f0c9cadd30b87ba

Reviewed By: @ptarjan

Differential Revision: D1430034