Fix vote limiting by ID

Uses the `X-Forwarded-For` header to determine users' IP addresses, instead of naively using Heroku's internal IPs, so duplicate votes are now correctly prevented.

Fixes a bug that would cause a title to be un-votable by all users once a user who has voted for it reloads the page. (`var newTitle = title;` was creating a reference, but we needed a copy of the original title object.)

Makes some minor style improvements.

This just creates a reference to the same object, it doesn't copy it. There is not built-in way to copy objects in JavaScript, although `JSON.parse(JSON.stringify(..))` would be the simplest solution for simple cases like this.

(JavaScript might be getting custom value types eventually, but it doesn't have them yet.)