Refactored mustache.js into core