Fix sorting of Rubygem#public_version

This is a rebase of PR #307 (that has been merged, but reverted later), just rebased to current master, closes #700. It also explicitely requires `order('versions.position')` for `Version#by_position` to stay clear & consistent.