Move endsWith string function into default.js