Energy Harvesting Communications with Batteries Having Cycle Constraints