Adds some tests using Mocha, including a failing test of a new crashing attack.
Adds a .travis.yml file to enable testing with Node 0.10 and 0.11.
Adds logic to disconnect users who send non-JSON data.
This prevents a possible crashing attack.

Resolves test failure.
Adds a hook for tests to disable the disconnection of additional connections from a flooding address.
Also allows tests to modify the flood window size.

The current tests are relying on implementation details, and wouldn't
pass if our anti-flooding logic were more aggressive, because we're
expecting responses to messages from the same IP which does the flooding.
This resolves that by ensuring that they won't also be disconnected.
Makes test verify that attacking users were disconnected and non-attacking were not.

I don't think this is the way afterEach() should ideally be used --
assert() will abort the test suite rather than just fail the current
test -- but it works.
Add tests for some simple local flooding attacks, one of which can
reliably trigger crashes if flood prevention is commented-out.

Rollback some unnecessary changes to accidentalbot.js.

Commenting out messages logged when responding to attacks -- letting
them flood your log wouldn't be great either.
Prevent a type of flooding crash by adding an explicit no-op socket error handler.
Makes votes for invalid vote IDs count 5x as strongly towards flood detection.

Fix a mistake in a test (the invalid JSON wasn't being sent!).

Adds a bit more logging so we're aware of all messages and errors -- if
users are going to send something to bring it down, we should hope to
have at least some related log messages (even if still not very detailed).

Keeps track of which addresses have already been disconnected in the
current window, so that they can be more efficiently ignored (without
logging) for subsequent messages in the same window.
Merge branch 'test-protection' into webclient-jeremy

Conflicts:
	accidentalbot.js