Add AST type definitions to handlebars.d.ts

Also put a module around the "SafeString" type to fix the compiler error.
Merge pull request #2943 from gscshoyru/patch-11

Add AST type definitions to handlebars.d.ts