moved dom/json functions into kjs module