Performance: Various performance improvements to context.set
Performance: Small performance improvement due to code simplification