Adding main loop function.

Renaming draw() into tick(), calling it through setInterval().
Fixed issue where resizing the window before chat injection would generate
a runtime exception.
Added pushComment() as entry point for incoming chats.