Completed migration to typescript.

Link to code review: http://mrccodereview.cloudapp.net/ui#review:id=1084