Basic program loop and data structure definitions.