when restart, compact all the log entries before snapshot. Avoid wrong startTerm
delete print
should break instead of return
Merge pull request #99 from coreos/fixSnapshot

Fix snapshot
add mutex
add defer to guard against unexpected panics
Merge pull request #101 from Mistobaan/master

add mutex
use switch.(type)
use switch.(type)
nip comment
use switch.(type)
use switch.(type)
Merge pull request #102 from Mistobaan/master

use switch.(type) instead