performance optimizations, parses a 500kb JS file in ~0.15seconds