Dom based javascript template engine