Extension support for embedding API

Your comment is aligned with my patch set1. This is how reflection works, unless I understood wrongly. ping @wang16 .