Add tests covering data alignment and missing values.

**Work in progress -- do not merge**

It looks like something about data alignment is broken in master. I haven't tested this part of the code since the big refactor. I'll take a closer look soon. We need to address this before the release.