Refactor to query builder; added triggers

Instead of recomputing comment/fav/tag count from scratch on every request,
store it in DB as *_count columns that get updated with proper triggers.
Next/prev links are bound to latest search query
Various JS optimizations
Markdown: fixed matching ( ) and { } in links
Mass tag: fixed concurrent tag toggling
User settings: added opt-in tags in post thumbs
Fixed hotkeys conflicting with Flash on Chrome
Layout: fixed autocomplete box position