Fix the resizing of `DynamicArray1D` and add a couple of tests. Fixes #248
Remove the `allocate_array` function that isn't used anymore.