Fix connect test, which was passing an options object

An options object isn't supported, it was being used as an address, and
passed as a final argument to createConnection(port,...), where it was
ignored because it is not a function. This becomes noticeable once the
default port becomes correct, and you are running a STOMP server,
because this test ends up using a valid default port.
Fix errors caused by calling a null function

Don't register for the 'connect' event if there is no connectedCallback.
Correctly end the TCP connection

The previous method of simulating an incoming end and then doing an
outgoing end in the 'end' event handler, besides being convoluted and
unnecessary, causes the 'disconnect' event to be emitted twice: once for
fake 'end' event, and once when the server actually ends the connection.
That this would occur was obvious on examination of the code, but was
first noticed when logging the disconnect callback during disconnect
from a real STOMP server.

Note that the mock tcp stream used in the test did not correctly emulate
what happens when a TCP stream is shutdown (that an outgoing .end()
causes an incoming 'end' event).
Return this so stomp methods can be chained
Fix error when no disconnected callback passed
Allow message headers to be specified on publish

This allows the content-type header to be specified, a SHOULD
in STOMP 1.1.
Fix argument order of subscribe, so callback is last

Accepts the old argument order, for compatibility, but callback as last
argument is the node convention. Also assert that the mandatory callback
is provided, otherwise the error is delayed until a MESSAGE is received,
where it is unrecoverable.
Use EventEmiter to manage list of error callbacks

StompClient was using its own code to handle a list of callbacks for
errors. The code was nearly identical to that in EventEmitter, from
which StompClient is derived.
Pass an Error object to the error callback

This is the convention, for good reason, it captures a stack trace and
provides a consistent interface. All message headers are set as
properties of the Error object, so the API is backwards compatible.
Fix race condition between UNSUBSCRIBE and MESSAGE

MESSAGE can still arrive after UNSUBSCRIBE is sent, but the callbacks
were deleted, this would lead to calling .map() on null.
Fix unsubscribe(), it was modifying its header argument
Whitespace cleanup, terminate all lines with a NL

Git, and other tools, expect this, lack of NL on line endings causes
weirdness with diffs.
Merge pull request #15 from sam-github/local

Batch of improvements and bug fixes