results.html: Append existing query to details page URL

Issue #134.
r.php: Set search text from query string

Issue #134.
r.php: Minor style fixes