If you're looking to rewrite the game, I'd recommend looking into Unity3D[1] instead of trying to make it in JavaScript. It'll be a lot less painful.
Out of the gate, Unity3D provides a much better indie game development environment than trying to do it JavaScript. Even though their name includes "3D", their software fully supports 2D games. Plus, there are no royalties/costs for the personal edition.
EDIT: Read my response below for context regarding this message. And if you're disagreeing because I said JavaScript game development is painful, then keep hammering this message to your delight.
I respect that the Wesnoth community may not want to go this route, and wouldn't blame anyone for that at all. My suggestion was more along the lines of "here's an option which won't be nearly as painful" than anything else.
While Unity3D is conditionally free-as-in-beer, it definitely isn't free-as-in-speech. Unreal Engine has recently gone kinda free too, but not really.
In any event, best wishes to the Wesnoth community and continued fun to be had by both those playing it and those progressing it.
Out of the gate, Unity3D provides a much better indie game development environment than trying to do it JavaScript. Even though their name includes "3D", their software fully supports 2D games. Plus, there are no royalties/costs for the personal edition.
1 - http://unity3d.com/get-unity
EDIT: Read my response below for context regarding this message. And if you're disagreeing because I said JavaScript game development is painful, then keep hammering this message to your delight.