Added implementation of extend and closest. No longer depending on jQuery in the vanilla shim