Made script executable
Debug output removed
Colors moved to variables
Split up handling of input events to distinguish Tab, Left/Right and Enter from actual character inputs.