better as_string implementation where leafs are sorted
more tests