run idle callbacks each loop.
fix so session correctly prints all inbuffer content to screen.
change so that when adding a new session it automatically becomes the active session.
implement application destroy function.
fix stdin input, it hung in the while loop.
refactor the application struct into its own file.