wal: add marshaler interface

1. Add a Marshaler Interface into raft package
```go
type Marshaler interface {
 	Marshal() ([]byte, error)
 	MarshalType() int64
 }
```

2. Use Marshaler in wal pkg. simplify things a lot.

3. WARNING: remove head checking when writing node.Info.
@bmizerany I define the MarshalType() here, since go dose not allow non-local method declaration. 
So I also declare the interface in this pkg. 
Moreover, I want to return `Info`, `Entry`, `State` and `Snap` in one function instead of having `UnstableState`, `UnstableState`...