Pull DOM manipulation code into classes and it's own typescript module.