Extract common JS functions to base.js and wrap them in an object.
Remove common JS functions from application.js and include them from base.js.
Don't override built-in functions, we can use ours in XML.