Add some unit tests + doc