Moving to TypeScript. Work in progress.