Implement reflection based state and event registration
Add tests for the reflection based event and state registration