Added tests for hooks and layout

Please keep in mind that the current XML::Twig is (afaics) buggy and
it escapes the end of CDATA for unknown reasons.