Node-Level Energy Management for Sensor Networks in the Presence of Multiple Applications