Socket cleanup

Rename the callback a proc, and refactor to do all the opts handling in #initialize.