Surface energy and structure of crystal boundaries in metals