NOTE: It is pretty straighforward and ugly, so make sure you check all the changes it does. :P --HG-- branch : trunk