Make index updates properly idempotent

- Improve timestamp support for queries:
    - use placeholder syntax & Long conversion for the parameter
    - don't use it with the .if condition
- Make index updates properly idempotent by using proper timestamps for the
  respective queries:
    - data updates use the corresponding data row's timestamp
    - _del updates use the index update's timestamp, so that the most up to
      date index update wins
- Improve tests by checking the full results of get queries