Tweaks so that Draw2D sample can be tested in windows and compiled to JS from same codebase.