Make connect callback optional. Closes #1
Document close/end difference