Port lib/typescript.js to TypeScript 0.9.5

Issue #265
Closes #288
Closes #289
Pass allowReturnOutsideFunction to acorn

Issue marijnh/acorn#86