Minecraft wiki entry for Development_versions, associated text: Added for repairing, merging & naming items.
Three different damage states: Anvil, Slightly Damaged Anvil, and Very Damaged Anvil.
Anvils cannot only rename tools and armor, but any item.
Renamed placeable items will not retain their name if placed.
Anvils can merge enchantments.
Items with two different enchantments will give an item with both.
Items with the same enchantment will increase the level of the enchantment if they have the same level or take only the highest if they don't.
Some enchantments can be lost during the merging because of incompatibility (ex: Sharpness I + Smite I).
The first item seems to have the priority (the lost enchantments are on the second item).
Anvils can also be dropped in a similar manner to Sand, Gravel, and Dragon Eggs.
When landing on a mob, the anvil will deal damage relative to the distance it fell.