Closes #323 via #381
Closes #317 via #382
Most errors highglighted by TS were due to a lack of type definitions and were ignored by settings types to `any`. Some minor bugs were resolved where the fix was obvious. TODO marks left where `any` needs to be later removed or bugfix verified
The TypeScript build currently runs but fails for a number of files. This commit only contains rename operations on the source files.