Cleanup build_tag_map

Millions of temp variables. Assuming there's only two sorting methods. Grammar.
[show 100 more problems]
Relevance sorting method
Config option for which tags to ignore
Tag Category integration
Polish
Extra-switch fixes

Wrong variable name, and don't do the math unless we have to.
Fixed the diplayed number being wrong.
Also fixed a corner case where number of tags in the cloud equals number to
display. Would display "[show 0 more tags]".
Fix another corner case

If $counter == $def_count and the next tag in the list is a used tag, the
tagcloud_extra div would be printed twice, breaking the list.

This solution feels ugly, perhaps there's a better way to do this?
Use API calls
Properly escape tags while building query

Could it really be that easy?
Fixed tags with quotes killing the Javascript

Of course not.
Merge pull request #340 from jgen/master

Some small tweaks/changes
Unify two regexes used in rating searches, intersect with user privs

Fixes issue with unpriveleged users being able to circumvent the ratings
they could see, just by searching for it.  Also makes code much much
prettier.
Merge pull request #342 from NuckChorris/fix-rating-ext

Fix rating circumvention issue
Merge pull request #341 from jgen/master

More small tweaks
ignore vim undo files
lower tags before checking for mass replacement
Fixing rating= search
Also checking rating permissions
ext\rating documentation
Merge pull request #345 from tkorpe/master

Fixing rating= search