fix item list version sorting to obey semver

As MySQL does not allow custom comparison functions, this is a
little complicated:

- Add 3 stored MySQL functions / procedures that collect all compare
  and sort the required semver data.
- Then add a method to SortHelper that collects the necessary data
  beforehand and stores it in a temporary MySQL table.
- Last, fix items/list.php to allow multiple table joins and use one
  to sort by version.