Replace public statics with private to prevent deprecation errors

These public statics are deprecated and will fail tests under the framework master branch
Use Versioned::get_latest_version() instead of sorting ourselves

The will fix this module running under postgresql since it requires that the
order by is declared in the select part of the query.