Tweak sorting settings on stale relations page

* Don't allow sorting of packages columns, doesn't make much sense
* Default to sorting by pkgbase on all tables
* Ensure all JS is executed inside doc.ready function (wow, how has this
  been wrong for so long?)

Signed-off-by: Dan McGee <dan@archlinux.org>
Only show arches/repos that are necessary

After the refactor in commit 7947d36c4, we weren't gathering arches and
repos from the correct list of packages. Fix this.

Signed-off-by: Dan McGee <dan@archlinux.org>
Change case of SUM() SQL function
Package search HTML cleanups

Signed-off-by: Dan McGee <dan@archlinux.org>
FS#30773: put exact matches at top

There have been a few proposed solutions to this, but there really isn't
anything without a drawback. Things break pagination, require loading
the entire result set from the database, etc.

Just plop a new table on the page if someone did a so-called "simple"
search and we have a match. Only show on the first page of the search
results. This results in a relatively fast experience for someone doing
something like searching for the "perl" package.

Signed-off-by: Dan McGee <dan@archlinux.org>
Fix colspan values

Signed-off-by: Dan McGee <dan@archlinux.org>
Tweak search results page a bit more

Signed-off-by: Dan McGee <dan@archlinux.org>