Added tests and introduced dgeni.