Refactoring tbl_relation.php

Hi Marc,
I have extracted the code responsible for rendering html from tbl_relation.php to tbl_relation.lib.php