Added .extend() code and tests.