More tests, and new code for append/prepend.