Implement skeleton of the main loop
Initial commit