Cleaned up textgrid internals.
Cleaned up textgrid API.