Fix random number example; refactor Script, EventWriter & InputDefinition to work w/ Streams AND Buffers