reformatted connect.js
globalized chunk and file sending methods
merging in changes from both sides