For now this only handles the 1D case. In theory it would work for any dense array, however, I found that ndarray_is_dense didn't behave for me so I implemented this instead. Add a test. Before the change, this test would segfault. Closes #328.