Better extend function

For more usefull and expected class inheritance:
```javascript
var circle = new Kinetic.Circle();
test(circle instanceof Kinetic.Circle);
test(circle instanceof Kinetic.Shape);
```