added events
made extended method a method returning an "extended" klass with the option to add prototype methods and properties