Update timestamp generation to support ActiveSupport::TimeWithZone

We found that the current method for generating unix timestamps in `ScriptTag` can produce the wrong timestamp for `ActiveSupport::TimeWithZone` objects.

It seems that `TimeWithZone#strftime('%s')` will yield a timestamp that includes daylight savings offsets. The resulting timestamp will be an hour adrift if daylight savings are in effect.

This PR switches to using `to_i` directly on `Time`, `DateTime` and their descendants.