made a pass at conforming to established naming convention
fixed various warnings about converting size_t to int
fixed warnings related to ESM loading performance improvements