Consolidates translation code

Fixes #565 - consolidates translation code.

Ahh, I see, the pending tests were the translate tests. The problem with those was the cookie was being set on 127.0.0.1 and .0.1 or something, so they had different domains and weren't both getting updated.
Well, anyway, I see there's a lot of code with these like you said, but check it out. The implementation seems stable to me, but if it doesn't seem like this'll do we can remove them. Only thing, I wasn't sure where the `port` should live for the tests so it's hardcoded to `4000`, however it needs a trailing `/` locally but not on Travis apparently.