Add some error checking in function fromArray().
Tests for that function and for unfoldr().