Added `time` argument for Entity#insert and Entity#update to specify exact time to be stored in history - it's a requirement for conversion of history from old SQL dumps.
`ts` field is now strictly INT - MySQL seems to be too unreliable with timezones to work with DATETIME directly in this situation.