Add boolean field flag 'is_latest' to document version to speed up latest_version calculation.
Also solves issue with MySQL version that do not store milliseconds in time fields. The 1 second delay in the version tests can be removed if this is solved.