Extract portions of RuntimeUtils relevant to profiling

Put them in JavaAgent, change build process accordingly