[time.js] added time.Time.validate and use it in time.Time constructor

time.Time.validate checks whether a given plain object representing a time makes sense. If not, an
error will be thrown.

Change-Id: I1431c9f9bdeff711713a4f5c56ae8b1c63bcb533