Refactor commit and improve code coverage.

Define serializable keys as a constant.
This reduces ivar allocation on every commit instance.

Coverage improves:
* commit_spec.rb: 87.14% -> 98.57%
* overall: 90.91% -> 92.16%