Added helper methods to access struct through reflection. (#4120)

* Added helper methods to access struct through reflection. Also added unit test for it.

* Added a TODO comment to check for the is_struct flag.
2 files changed