Porting Wezside Toolkit from AS3 to JS