Ported everything to JavaScript.