More work on self join elimination ; unfortunately fails some test cases - seems as if the serialization goes wrong