Separate implementation of OneDGrid

Fixes #46.