Sweeping changes have been made to villagers in patch 1.2. They have not yet reached their original design but, the new changes have created a much more organic interaction.
The villagers AI have undergone a substantial upgrade. Villagers will now interact with each other as well as interact with some passive mobs.
Villagers will now search out homes within the village and will go inside and seek shelter from the rain or during night.V They have also gained some survival technique and will flee from zombies seeking shelter in the village structures. Zombies will continue to pursue villagers and if the game is set to hard mode they will break down wooden doors and kill all the villagers inside.
The most important addition to villagers is their ability to mate. The mating of villagers is the only way to spawn an iron golem in survival mode. Villagers will mate without any direct interaction with the player but do require certain criteria to be met first.
For villagers to mate there must be available houses in the village. A house is defined as a wooden door that has an inside and access to the outside. Only wooden doors count toward mating villagers. Iron doors and trap doors will not promote villager mating.
The inside of a house is determined by whether or not the door is within five blocks of a roof. For a roof to be valid it top must be exposed to the outside and its bottom must be part of an enclose structure.
Villagers mate in a near 1/3 ratio (.35 is the exact number) meaning that for every three doors there can be one villager.
Because doors are used to indicate a house it is possible to create efficient structures with multiple doors to promote faster mating. Buildings like this are unsightly but can be used if the player is only interested in spawning a golem.