Closes #4, adds auto socket restart.