#101 moved a good portion of logic to Typescript. `index.js` is still a behemoth, but should eventually also be moved to `Typescript`.