Migrate application to TypeScript to take advantage of its support for strong typing, and to reduce type errors.