Refactored to better represent New Relic's plugin API. This code now works to send data to the API but not in an ideal fashion yet.