Refactor remaining parts of app into TypeScript classes/modules