Remove dependency on 'extend' module

I thought it might be simpler just to use a simple routine to achieve the same effect, rather than depend on a separate module. What do you think?