Add main loop and quit functionality
Add keyboard support