First rewrite of the library to make it compile again and be called hdo.

It is exactly the same library as before.