Add support for arbitrary events and logical index

User can now define their own event codes and can choose whether to return
the results as a list of frame numbers, or as a logical index array.
Imrpoved README