Genral cleaning

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Added licences
Added tests

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>