Electromagnetic Energy Harvesting and Wireless Power Transmission: A Unified Approach