Escape links on /branches better

Branch names may contain characters that need escaping in URLs, like '#'.
Make sure to escape those.

For this purpose, add a helper class, htmlutils.URL, that constructs the
query part of the URL safely using urllib.urlencode().
Report "Missing param 'repository'" when there is no repository
Add TC for "Report "Missing param 'repository'" when there is no repository"
Escape branch name properly in SELECT for choosing new branch "base"

Repro:
1. push branch with commits A <- master "a#b_1"
2. push branch with commits B <- A <- master called "a#b_2"
2. push branch with commits C <- B <- A <- master called "a#b_3"
3. on /branches select "a#b_3" and choose "a#b_1" in
   the "select with base" dropdown
4. click "perform rebase" button
Fix error message when invalid base branch is specified
Add TC for "Fix error message when invalid base branch is specified"
Properly escape branch links in /showcommit info header
Drop unused imports in showcommit.py