Make TS compiler add AMD headers

Changes I had to make to run with latest TypeScript 8.3.1