Refactor core.js. Removing after, before, filter internal function definitions. Adding default implementations of this function