fix for multiple commands within single connection

there was a bug where if several commands are sent within a single
write() call (a common thing in node), only the first message would be
parsed
add a test for multiple commands in one connection