Dispatch commit event.

This pull request makes two changes: 

1. Dispatches the `CommitEventType` event on each commit.

2. Makes `LogEntry.encode()` and `LogEntry.decode()` into exported functions (`Encode()`/`Decode()`).