Initial work on #255

Tests and documentation are missing.

Signed-off-by: Clement Escoffier <clement.escoffier@gmail.com>