To be integrated from Mincong HUANG's Google Summer Of Code, then polished a bit (see the issues on the same repo), then merged.