Added an events object to notify global events, all errors are now handled by it
Optimized book store example