Add defineClass to addons

Warning: lot of code!
This pull request adds a `defineClass` method to addons similar to Twitter Flight's `defineComponent`. See the tests for usage examples. I've tried to keep changes to core files to a minimum, and have only exposed/extracted some parts of `ReactCompositeComponent` to prevent duplicated code.