fixed build order by refactoring analytics client into a common analytics_publisher and a analytics_endpoint plugin