Safety and simplicity for rich web applications