Completed hibernate relations support.

Now we can generate valid hibernate configuration files and a test main
that support 1:n-(mono|bi) and n:n-(mono|bi) relations.

Format code. Add samples.