Improve definition file management

I started this because the bundled lib.d.ts is out of date, and gives errors on TypeScript 1.3.0. This has been "fixed" in the lib.d.ts file bundled with that version, by [commenting out the offending line](https://github.com/Microsoft/TypeScript/blob/master/bin/lib.d.ts#L8748). So it seemed best to just follow whatever file comes with the compiler.

I ported it to tsd and updated the definitions for node while I was at it.