implemented 'poke' command to restart daemon if necessary

Also a minor refactoring of 'check' command.