Move agent implementation to internal package.
Add runtime APIs.