Event driven Sandbox implementation with permission management for modular javascript architecture