better ping/command handling

closes #7