major refactoring to support win8, wp8 and web from a nodejs build.