Set up simple Rack proxy
Remove Accept-Encoding header from request

This prevents gov.uk from sending us a compressed response,
wbich would be harder to rewrite.
Remove Status header from response

gov.uk sends this header, but the Rack specification says
that it shouldn't be part of the response.
Remove Transfer-Encoding header from response

Even if we get a chunked response from gov.uk, it's no longer
chunked by the time we send it.
Use Rack::Static to serve (empty) mirror.js
Add middleware to insert <script> tag
Install Thin
Install Faye
Insert Faye JavaScript into page
Synchronise scroll positions
Synchronise current URLs on link click
Maintain current protocol, hostname and port when navigating
Only navigate to internal links
Rewrite redirect responses
Send scroll and navigate events on each page load
Override window.history.pushState to publish navigation events
Cache the current scroll position and URL on the server
Republish the current scroll position and URL during handshake

This makes the controlling browser proactively freshen the server state,
instead of allowing the server to send stale state to mirroring browsers
until a user interaction causes the controlling browser to send a message.
Send the current scroll position and URL in subscription messages
Restore state when subscription messages are received