Now making extensive use of promises. Including the possibility of handling notification errors with a promise also.
* Feature: Certificate and Key data can be passed directly when creating a new connection instead of providing a file name on disk. (See: `certData` and `keyData` options) * Deliver whole write buffer if the socket is ready. * Fixed some global memory leaks. * Tidied up some code formatting glitches flagged by jslint * Fixes #16, #17, #18, #19, #20
Issue #1 fixed where error callback was incorrectly referenced.