Minecraft wiki entry for Development_versions, associated text: Villagers will buy or sell the player emeralds in exchange for certain items.
Trade with villagers by right-clicking on them, opening up a GUI with one buying slot and one selling slot.