Change append/prepend to return new length of the array

Hey, I had an attempt at changing the append and prepend functions in the array shims so that they pass the new length of the array in the callback. This is the first thing I've tried to do with the codebase so it might be a bit crap. :-)

I'm really not sure about the unit tests, it was saying that tests had failed, however I couldn't get any helpful output or get the tests to pass on your master either. Also I'm rubbish at unit tests.