Adds tests for writing time tags.
Fixed conversion between JS and NTP timestamps.