Fix pegvm api

This PR cleanup and refactor pegvm and NODE api.