refactor mdcore x$.remove. remove hanging references in mdtemplate.js