Modified MexWrapperGenerator.

Bug Fix : Used getMainNode method to ensure entry point function is fetched.