WIP: Changing textgrid API and implementation; part of #151.